home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / cryptography-faq.rsa.part1 < prev    next >
Encoding:
Internet Message Format  |  1994-05-01  |  50.2 KB

  1. Subject: RSA Cryptography Today FAQ (1/3)
  2. Newsgroups: sci.crypt,talk.politics.crypto,alt.security.ripem,sci.answers,talk.answers,alt.answers,news.answers
  3. From: faq-editor@rsa.com
  4. Date: 29 Apr 1994 21:57:24 GMT
  5.  
  6. Archive-name: cryptography-faq/rsa/part1
  7. Last-modified: 93/09/20
  8. Version: 2.0
  9.  
  10.  
  11. (This document has been brought to you in part by CRAM.  See the
  12. bottom for more information, including instructions on how to
  13. obtain updates.)
  14.  
  15. ===
  16.  
  17.  
  18.                           Answers To
  19.                  FREQUENTLY ASKED QUESTIONS
  20.                  About Today's Cryptography
  21.  
  22.  
  23.  
  24.                           Paul Fahn
  25.                       RSA Laboratories
  26.                      100 Marine Parkway
  27.                    Redwood City, CA  94065
  28.  
  29.  
  30.  
  31.    Copyright (c) 1993 RSA Laboratories, a division of RSA Data Security,
  32.       Inc. All rights reserved.
  33.  
  34.    Version 2.0, draft 2f
  35.    Last update: September 20, 1993
  36.  
  37.  
  38.  
  39. ------------------------------------------------------------------------
  40.                          Table of Contents
  41.  
  42. [ part 1 ]
  43.  
  44. 1 General
  45.        1.1  What is encryption?
  46.        1.2  What is authentication? What is a digital signature?
  47.        1.3  What is public-key cryptography?
  48.        1.4  What are the advantages and disadvantages of public-key
  49.             cryptography over secret-key cryptography?
  50.        1.5  Is cryptography patentable in the U.S.?
  51.        1.6  Is cryptography exportable from the U.S.?
  52.  
  53. 2 RSA
  54.        2.1  What is RSA?
  55.        2.2  Why use RSA rather than DES?
  56.        2.3  How fast is RSA?
  57.        2.4  How much extra message length is caused by using RSA?
  58.        2.5  What would it take to break RSA?
  59.        2.6  Are strong primes necessary in RSA?
  60.        2.7  How large a modulus (key) should be used in RSA?
  61.        2.8  How large should the primes be?
  62.        2.9  How does one find random numbers for keys?
  63.        2.10  What if users of RSA run out of distinct primes?
  64.        2.11  How do you know if a number is prime?
  65.        2.12  How is RSA used for encryption in practice?
  66.        2.13  How is RSA used for authentication in practice?
  67.        2.14  Does RSA help detect altered documents and transmission errors?
  68.        2.15  What are alternatives to RSA?
  69.        2.16  Is RSA currently in use today?
  70.        2.17  Is RSA an official standard today?
  71.        2.18  Is RSA a de facto standard? Why is a de facto standard important?
  72.        2.19  Is RSA patented?
  73.        2.20  Can RSA be exported from the U.S.?
  74.  
  75. [ part 2 ]
  76.  
  77. 3 Key Management
  78.        3.1  What key management issues are involved in public-key
  79.             cryptography?
  80.        3.2  Who needs a key?
  81.        3.3  How does one get a key pair?
  82.        3.4  Should a public key or private key be shared among users?
  83.        3.5  What are certificates?
  84.        3.6  How are certificates used?
  85.        3.7  Who issues certificates and how?
  86.        3.8  What is a CSU, or, How do certifying authorities store their
  87.             private keys?
  88.        3.9  Are certifying authorities susceptible to attack?
  89.        3.10  What if the certifying authority's key is lost or compromised?
  90.        3.11  What are Certificate Revocation Lists (CRLs)?
  91.        3.12  What happens when a key expires?
  92.        3.13  What happens if I lose my private key?
  93.        3.14  What happens if my private key is compromised?
  94.        3.15  How should I store my private key?
  95.        3.16  How do I find someone else's public key?
  96.        3.17  How can signatures remain valid beyond the expiration dates of
  97.              their keys, or, How do you verify a 20-year-old signature?
  98.        3.18  What is a digital time-stamping service?
  99.  
  100. 4 Factoring and Discrete Log
  101.        4.1  What is a one-way function?
  102.        4.2  What is the significance of one-way functions for cryptography?
  103.        4.3  What is the factoring problem?
  104.        4.4  What is the significance of factoring in cryptography?
  105.        4.5  Has factoring been getting easier?
  106.        4.6  What are the best factoring methods in use today?
  107.        4.7  What are the prospects for theoretical factoring breakthroughs?
  108.        4.8  What is the RSA Factoring Challenge?
  109.        4.9  What is the discrete log problem?
  110.        4.10  Which is easier, factoring or discrete log?
  111.  
  112. 5 DES
  113.        5.1  What is DES?
  114.        5.2  Has DES been broken?
  115.        5.3  How does one use DES securely?
  116.        5.4  Can DES be exported from the U.S.?
  117.        5.5  What are the alternatives to DES?
  118.        5.6  Is DES a group?
  119.  
  120. [part 3]
  121.  
  122. 6 Capstone, Clipper, and DSS
  123.        6.1  What is Capstone?
  124.        6.2  What is Clipper?
  125.        6.3  How does the Clipper chip work?
  126.        6.4  Who are the escrow agencies?
  127.        6.5  What is Skipjack?
  128.        6.6  Why is Clipper controversial?
  129.        6.7  What is the current status of Clipper?
  130.        6.8  What is DSS?
  131.        6.9  Is DSS secure?
  132.        6.10  Is use of DSS covered by any patents?
  133.        6.11  What is the current status of DSS?
  134.  
  135. 7 NIST and NSA
  136.        7.1  What is NIST?
  137.        7.2  What role does NIST play in cryptography?
  138.        7.3  What is the NSA?
  139.        7.4  What role does the NSA play in commercial cryptography?
  140.  
  141. 8 Miscellaneous
  142.        8.1  What is the legal status of documents signed with digital
  143.             signatures?
  144.        8.2  What is a hash function? What is a message digest?
  145.        8.3  What are MD2, MD4 and MD5?
  146.        8.4  What is SHS?
  147.        8.5  What is Kerberos?
  148.        8.6  What are RC2 and RC4?
  149.        8.7  What is PEM?
  150.        8.8  What is RIPEM?
  151.        8.9  What is PKCS?
  152.        8.10  What is RSAREF?
  153.  
  154. --------------------------------------------------------------------
  155.  
  156.  
  157. 1 General
  158.  
  159. 1.1 What is encryption?
  160.  
  161. Encryption is the transformation of data into a form unreadable by anyone
  162. without a secret decryption key. Its purpose is to ensure privacy by
  163. keeping the information hidden from anyone for whom it is not intended,
  164. even those who can see the encrypted data. For example, one may wish to
  165. encrypt files on a hard disk to prevent an intruder from reading them.
  166.  
  167. In a multi-user setting, encryption allows secure communication over an
  168. insecure channel. The general scenario is as follows: Alice wishes to
  169. send a message to Bob so that no one else besides Bob can read it. Alice
  170. encrypts the message, which is called the plaintext, with an encryption
  171. key; the encrypted message, called the ciphertext, is sent to Bob. Bob
  172. decrypts the ciphertext with the decryption key and reads the message. An
  173. attacker, Charlie, may either try to obtain the secret key or to recover
  174. the plaintext without using the secret key. In a secure cryptosystem, the
  175. plaintext cannot be recovered from the ciphertext except by using the
  176. decryption key. In a symmetric cryptosystem, a single key serves as both
  177. the encryption and decryption keys.
  178.  
  179. Cryptography has been around for millennia; see Kahn [37] for a
  180. good history of cryptography; see Rivest [69] and Brassard
  181. [10] for an introduction to modern cryptography.
  182.  
  183.  
  184. 1.2 What is authentication? What is a digital signature?
  185.  
  186. Authentication in a digital setting is a process whereby the receiver of a
  187. digital message can be confident of the identity of the sender and/or the
  188. integrity of the message. Authentication protocols can be based on either
  189. conventional secret-key cryptosystems like DES or on public-key systems
  190. like RSA; authentication in public-key systems uses digital signatures.
  191.  
  192. In this document, authentication will generally refer to the use of digital
  193. signatures, which play a function for digital documents similar to that
  194. played by handwritten signatures for printed documents: the signature is an
  195. unforgeable piece of data asserting that a named person wrote or otherwise
  196. agreed to the document to which the signature is attached. The recipient, as
  197. well as a third party, can verify both that the document did indeed originate
  198. from the person whose signature is attached and that the document has not
  199. been altered since it was signed. A secure digital signature system thus
  200. consists of two parts: a method of signing a document such that forgery is
  201. infeasible, and a method of verifying that a signature was actually generated
  202. by whomever it represents. Furthermore, secure digital signatures cannot be
  203. repudiated; i.e., the signer of a document cannot later disown it by claiming
  204. it was forged.
  205.  
  206. Unlike encryption, digital signatures are a recent development, the
  207. need for which has arisen with the proliferation of digital communications.
  208.  
  209.  
  210. 1.3 What is public-key cryptography?
  211.  
  212. Traditional cryptography is based on the sender and receiver of a message
  213. knowing and using the same secret key: the sender uses the secret key to
  214. encrypt the message, and the receiver uses the same secret key to decrypt
  215. the message. This method is known as secret-key cryptography. The main
  216. problem is getting the sender and receiver to agree on the secret key
  217. without anyone else finding out. If they are in separate physical locations,
  218. they must trust a courier, or a phone system, or some other transmission
  219. system to not disclose the secret key being communicated. Anyone who
  220. overhears or intercepts the key in transit can later read all messages
  221. encrypted using that key. The generation, transmission and storage of keys
  222. is called key management; all cryptosystems must deal with key management
  223. issues. Secret-key cryptography often has difficulty providing secure key
  224. management.
  225.  
  226. Public-key cryptography was invented in 1976 by Whitfield Diffie and
  227. Martin Hellman [29] in order to solve the key management problem. In the
  228. new system, each person gets a pair of keys, called the public key and
  229. the private key. Each person's public key is published while the private
  230. key is kept secret. The need for sender and receiver to share secret
  231. information is eliminated: all communications involve only public keys,
  232. and no private key is ever transmitted or shared. No longer is it necessary
  233. to trust some communications channel to be secure against eavesdropping
  234. or betrayal. Anyone can send a confidential message just using public
  235. information, but it can only be decrypted with a private key that is in
  236. the sole possession of the intended recipient. Furthermore, public-key
  237. cryptography can be used for authentication (digital signatures) as well as
  238. for privacy (encryption).
  239.  
  240. Here's how it works for encryption: when Alice wishes to send a message to
  241. Bob, she looks up Bob's public key in a directory, uses it to encrypt the
  242. message and sends it off. Bob then uses his private key to decrypt the
  243. message and read it. No one listening in can decrypt the message. Anyone
  244. can send an encrypted message to Bob but only Bob can read it. Clearly, one
  245. requirement is that no one can figure out the private key from the
  246. corresponding public key.
  247.  
  248. Here's how it works for authentication: Alice, to sign a message, does
  249. a computation involving both her private key and the message itself; the
  250. output is called the digital signature and is attached to the message,
  251. which is then sent. Bob, to verify the signature, does some computation
  252. involving the message, the purported signature, and Alice's public key. If
  253. the results properly hold in a simple mathematical relation, the signature
  254. is verified as genuine; otherwise, the signature may be fraudulent or the
  255. message altered, and they are discarded.
  256.  
  257. A good history of public-key cryptography, by one of its inventors, is
  258. given by Diffie [27].
  259.  
  260.  
  261. 1.4 What are the advantages and disadvantages of public-key cryptography
  262.     over secret-key cryptography?}
  263.  
  264. The primary advantage of public-key cryptography is increased security:
  265. the private keys do not ever need to be transmitted or revealed to anyone.
  266. In a secret-key system, by contrast, there is always a chance that an
  267. enemy could discover the secret key while it is being transmitted.
  268.  
  269. Another major advantage of public-key systems is that they can provide
  270. a method for digital signatures. Authentication via secret-key systems
  271. requires the sharing of some secret and sometimes requires trust of a
  272. third party as well. A sender can then repudiate a previously signed message
  273. by claiming that the shared secret was somehow compromised by one of the
  274. parties sharing the secret. For example, the Kerberos secret-key
  275. authentication system [79] involves a central database that keeps copies
  276. of the secret keys of all users; a Kerberos-authenticated message would
  277. most likely not be held legally binding, since an attack on the database
  278. would allow widespread forgery. Public-key authentication, on the other
  279. hand, prevents this type of repudiation; each user has sole responsibility
  280. for protecting his or her private key. This property of public-key
  281. authentication is often called non-repudiation.
  282.  
  283. Furthermore, digitally signed messages can be proved authentic to a third
  284. party, such as a judge, thus allowing such messages to be legally binding.
  285. Secret-key authentication systems such as Kerberos were designed to
  286. authenticate access to network resources, rather than to authenticate
  287. documents, a task which is better achieved via digital signatures.
  288.  
  289. A disadvantage of using public-key cryptography for encryption is speed:
  290. there are popular secret-key encryption methods which are significantly
  291. faster than any currently available public-key encryption method. But
  292. public-key cryptography can share the burden with secret-key cryptography
  293. to get the best of both worlds.
  294.  
  295. For encryption, the best solution is to combine public- and secret-key
  296. systems in order to get both the security advantages of public-key systems
  297. and the speed advantages of secret-key systems. The public-key system can
  298. be used to encrypt a secret key which is then used to encrypt the bulk
  299. of a file or message. This is explained in more detail in Question 2.12
  300. in the case of RSA. Public-key cryptography is not meant to replace
  301. secret-key cryptography, but rather to supplement it, to make it more
  302. secure. The first use of public-key techniques was for secure key exchange
  303. in an otherwise secret-key system [29]; this is still one of its primary
  304. functions.
  305.  
  306. Secret-key cryptography remains extremely important and is the subject of
  307. much ongoing study and research. Some secret-key encryption systems are
  308. discussed in Questions 5.1 and 5.5.
  309.  
  310.  
  311. 1.5 Is cryptography patentable in the U.S.?
  312.  
  313. Cryptographic systems are patentable. Many secret-key cryptosystems
  314. have been patented, including DES (see Question 5.1). The basic ideas
  315. of public-key cryptography are contained in U.S. Patent 4,200,770, by M.
  316. Hellman, W. Diffie, and R. Merkle, issued 4/29/80 and in U.S. Patent
  317. 4,218,582, by M. Hellman and R. Merkle, issued 8/19/80; similar patents have
  318. been issued throughout the world. The exclusive licensing rights to both
  319. patents are held by Public Key Partners (PKP), of Sunnyvale, California,
  320. which also holds the rights to the RSA patent (see Question 2.19).
  321. Usually all of these public-key patents are licensed together.
  322.  
  323. All legal challenges to public-key patents have been settled before
  324. judgment. In a recent case, for example, PKP brought suit against the TRW
  325. Corporation which was using public-key cryptography (the ElGamal system)
  326. without a license; TRW claimed it did not need to license. In June 1992 a
  327. settlement was reached in which TRW agreed to license to the patents.
  328.  
  329. Some patent applications for cryptosystems have been blocked by intervention
  330. by the NSA (see Question 7.3) or other intelligence or defense agencies,
  331. under the authority of the Invention Secrecy Act of 1940 and the National
  332. Security Act of 1947; see Landau [46] for some recent cases related to
  333. cryptography.
  334.  
  335.  
  336. 1.6 Is cryptography exportable from the U.S.?
  337.  
  338. All cryptographic products need export licenses from the State Department,
  339. acting under authority of the International Traffic in Arms Regulation
  340. (ITAR), which defines cryptographic devices, including software, as
  341. munitions. The U.S. government has historically been reluctant to grant
  342. export licenses for encryption products stronger than some basic level
  343. (not publicly stated).
  344.  
  345. Under current regulations, a vendor seeking to export a product using
  346. cryptography first submits an request to the State Department's Defense
  347. Trade Control office. Export jurisdiction may then be passed to the
  348. Department of Commerce, whose export procedures are generally simple and
  349. efficient. If jurisdiction remains with the State Department, further
  350. review, perhaps lengthy, is required before export is either approved or
  351. denied; the National Security Agency (NSA, see Question 7.3) may become
  352. directly involved at this point. The details of the export approval
  353. process change frequently.
  354.  
  355. The NSA has de facto control over export of cryptographic products. The State
  356. Department will not grant a license without NSA approval and routinely grants
  357. licenses whenever NSA does approve. Therefore, the policy decisions over
  358. exporting cryptography ultimately rest with the NSA.
  359.  
  360. It is the stated policy of the NSA not to restrict export of cryptography
  361. for authentication; it is only concerned with the use of cryptography for
  362. privacy. A vendor seeking to export a product for authentication only will
  363. be granted an export license as long as it can demonstrate that the product
  364. cannot be easily modified for encryption; this is true even for very strong
  365. systems, such as RSA with large key sizes. Furthermore, the bureaucratic
  366. procedures are simpler for authentication products than for privacy products.
  367. An authentication product needs NSA and State Dept. approval only once,
  368. whereas an encryption product may need approval for every sale or every
  369. product revision.
  370.  
  371. Export policy is currently a matter of great controversy, as many software
  372. and hardware vendors consider current export regulations overly restrictive
  373. and burdensome. The Software Publishers Association (SPA), a software
  374. industry group, has recently been negotiating with the government in order
  375. to get export license restrictions eased; one agreement was reached that
  376. allows simplified procedures for export of two bulk encryption ciphers, RC2
  377. and RC4 (see Question 8.6), when the key size is limited. Also, export
  378. policy is less restrictive for foreign subsidiaries and overseas offices of
  379. U.S. companies.
  380.  
  381. In March 1992, the Computer Security and Privacy Advisory Board voted
  382. unanimously to recommend a national review of cryptography policy,
  383. including export policy. The Board is an official advisory board to NIST
  384. (see Question 7.1) whose members are drawn from both the government
  385. and the private sector. The Board stated that a public debate is the only
  386. way to reach a consensus policy to best satisfy competing interests:
  387. national security and law enforcement agencies like restrictions on
  388. cryptography, especially for export, whereas other government agencies and
  389. private industry want greater freedom for using and exporting cryptography.
  390. Export policy has traditionally been decided solely by agencies concerned
  391. with national security, without much input from those who wish to encourage
  392. commerce in cryptography. U.S. export policy may undergo significant change
  393. in the next few years.
  394.  
  395.  
  396. 2 RSA
  397.  
  398. 2.1 What is RSA?
  399.  
  400. RSA is a public-key cryptosystem for both encryption and authentication;
  401. it was invented in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman
  402. [74]. It works as follows: take two large primes, p and q, and find their
  403. product n = pq; n is called the modulus. Choose a number, e, less than n
  404. and relatively prime to (p-1)(q-1), and find its inverse, d, mod (p-1)(q-1),
  405. which means that ed = 1 mod (p-1)(q-1); e and d are called the public and
  406. private exponents, respectively. The public key is the pair (n,e); the
  407. private key is d. The factors p and q must be kept secret, or destroyed.
  408.  
  409. It is difficult (presumably) to obtain the private key d from the public
  410. key (n,e). If one could factor n into p and q, however, then one could
  411. obtain the private key d. Thus the entire security of RSA is predicated
  412. on the assumption that factoring is difficult; an easy factoring method
  413. would ``break'' RSA (see Questions 2.5 and 4.4).
  414.  
  415. Here is how RSA can be used for privacy and authentication (in practice,
  416. actual use is slightly different; see Questions 2.12 and 2.13):
  417.  
  418. RSA privacy (encryption): suppose Alice wants to send a private message,
  419. m, to Bob. Alice creates the ciphertext c by exponentiating: c = m^e
  420. mod n, where e and n are Bob's public key. To decrypt, Bob also
  421. exponentiates: m = c^d mod n, and recovers the original message m;
  422. the relationship between e and d ensures that Bob correctly recovers m.
  423. Since only Bob knows d, only Bob can decrypt.
  424.  
  425. RSA authentication: suppose Alice wants to send a signed document m to Bob.
  426. Alice creates a digital signature s by exponentiating: s = m^d mod n,
  427. where d and n belong to Alice's key pair. She sends s and m to Bob.
  428. To verify the signature, Bob exponentiates and checks that the message m
  429. is recovered: m = s^e mod n, where e and n belong to Alice's public
  430. key.
  431.  
  432. Thus encryption and authentication take place without any sharing of
  433. private keys: each person uses only other people's public keys and his or
  434. her own private key. Anyone can send an encrypted message or verify a signed
  435. message, using only public keys, but only someone in possession of the correct
  436. private key can decrypt or sign a message.
  437.  
  438.  
  439. 2.2 Why use RSA rather than DES?
  440.  
  441. RSA is not an alternative or replacement for DES; rather it supplements
  442. DES (or any other fast bulk encryption cipher) and is used together with DES
  443. in a secure communications environment. (Note: for an explanation of DES,
  444. see Question 5.1.)
  445.  
  446. RSA allows two important functions not provided by DES: secure key exchange
  447. without prior exchange of secrets, and digital signatures. For encrypting
  448. messages, RSA and DES are usually combined as follows: first the message is
  449. encrypted with a random DES key, and then, before being sent over an insecure
  450. communications channel, the DES key is encrypted with RSA. Together, the
  451. DES-encrypted message and the RSA-encrypted DES key are sent. This protocol
  452. is known as an RSA digital envelope.
  453.  
  454. One may wonder, why not just use RSA to encrypt the whole message and not use
  455. DES at all? Although this may be fine for small messages, DES (or another
  456. cipher) is preferable for larger messages because it is much faster than RSA
  457. (see Question 2.3).
  458.  
  459. In some situations, RSA is not necessary and DES alone is sufficient. This
  460. includes multi-user environments where secure DES-key agreement can take
  461. place, for example by the two parties meeting in private. Also, RSA is
  462. usually not necessary in a single-user environment; for example, if you want
  463. to keep your personal files encrypted, just do so with DES using, say, your
  464. personal password as the DES key. RSA, and public-key cryptography in general,
  465. is best suited for a multi-user environment. Also, any system in which digital
  466. signatures are desired needs RSA or some other public-key system.
  467.  
  468.  
  469. 2.3 How fast is RSA?
  470.  
  471. An ``RSA operation,'' whether for encrypting or decrypting, signing
  472. or verifying, is essentially a modular exponentiation, which can be
  473. performed by a series of modular multiplications.
  474.  
  475. In practical applications, it is common to choose a small public
  476. exponent for the public key; in fact, entire groups of users can use
  477. the same public exponent. This makes encryption faster than decryption
  478. and verification faster than signing. Algorithmically, public-key
  479. operations take O(k^2) steps, private key operations take O(k^3)
  480. steps, and key generation takes O(k^4) steps, where k is the number of
  481. bits in the modulus; O-notation refers to the an upper bound on the
  482. asymptotic running time of an algorithm [22].
  483.  
  484. There are many commercially available hardware implementations of RSA,
  485. and there are frequent announcements of newer and faster chips. The
  486. fastest current RSA chip [76] has a throughput greater than 600 Kbits
  487. per second with a 512-bit modulus, implying that it performs over 1000
  488. RSA private-key operations per second. It is expected that RSA speeds
  489. will reach 1 Mbit/second within a year or so.
  490.  
  491. By comparison, DES is much faster than RSA. In software, DES is generally at
  492. least 100 times as fast as RSA. In hardware, DES is between 1,000 and 10,000
  493. times as fast, depending on the implementations. RSA will probably narrow
  494. the gap a bit in coming years, as it finds growing commercial markets, but
  495. will never match the performance of DES.
  496.  
  497.  
  498. 2.4 How much extra message length is caused by using RSA?
  499.  
  500. Only a very small amount of data expansion is involved when using RSA. For
  501. encryption, a message may be padded to a length that is a multiple of the
  502. block length, usually 64 bits, since RSA is usually combined with a
  503. secret-key block cipher such as DES (see Question 2.12). Encrypting
  504. the DES key takes as many additional bits as the size of the RSA modulus.
  505.  
  506.  
  507. For authentication, an RSA digital signature is appended to a document.
  508. An RSA signature, including information such as the name of the signer, is
  509. typically a few hundred bytes long. One or more certificates (see Question
  510. 3.5) may be included as well; certificates can be used in conjunction
  511. with any digital signature method. A typical RSA certificate is a few
  512. hundred bytes long.
  513.  
  514.  
  515. 2.5 What would it take to break RSA?
  516.  
  517. There are a few possible interpretations of ``breaking RSA''. The most
  518. damaging would be for an attacker to discover the private key corresponding
  519. to a given public key; this would enable the attacker both to read all
  520. messages encrypted with the public key and to forge signatures. The obvious
  521. way to do this attack is to factor the public modulus, n, into its two prime
  522. factors, p and q. From p, q, and e, the public exponent, the attacker can
  523. easily get d, the private key. The hard part is factoring n; the security
  524. of RSA depends of factoring being difficult. In fact, the task of recovering
  525. the private key is equivalent to the task of factoring the modulus: you can
  526. use d to factor n, as well as use the factorization of n to find d. See
  527. Questions 4.5 and 4.6 regarding the state of the art in factoring. It should
  528. be noted that hardware improvements alone will not weaken RSA, as long as
  529. appropriate key lengths are used; in fact, hardware improvements should
  530. increase the security of RSA (see Question 4.5).
  531.  
  532. Another way to break RSA is to find a technique to compute e-th roots mod
  533. n. Since c = m^e, the e-th root of c is the message m. This attack would
  534. allow someone to recover encrypted messages and forge signatures even
  535. without knowing the private key. This attack is not known to be equivalent to
  536. factoring. No methods are currently known that attempt to break RSA in this
  537. way.
  538.  
  539. The attacks just mentioned are the only ways to break RSA in such a
  540. way as to be able to recover all messages encrypted under a given key.
  541. There are other methods, however, which aim to recover single messages;
  542. success would not enable the attacker to recover other messages
  543. encrypted with the same key.
  544.  
  545. The simplest single-message attack is the guessed plaintext attack. An
  546. attacker sees a ciphertext, guesses that the message might be ``Attack at
  547. dawn'', and encrypts this guess with the public key of the recipient; by
  548. comparison with the actual ciphertext, the attacker knows whether or not
  549. the guess was correct. This attack can be thwarted by appending some random
  550. bits to the message. Another single-message attack can occur if someone
  551. sends the same message m to three others, who each have public exponent
  552. e=3. An attacker who knows this and sees the three messages will be able
  553. to recover the message m; this attack and ways to prevent it are discussed
  554. by Hastad [35]. There are also some ``chosen ciphertext'' attacks, in
  555. which the attacker creates some ciphertext and gets to see the corresponding
  556. plaintext, perhaps by tricking a legitimate user into decrypting a fake
  557. message; Davida [23] gives some examples.
  558.  
  559. Of course, there are also attacks that aim not at RSA itself but at
  560. a given insecure implementation of RSA; these do not count as ``breaking
  561. RSA'' because it is not any weakness in the RSA algorithm that is exploited,
  562. but rather a weakness in a specific implementation. For example, if someone
  563. stores his private key insecurely, an attacker may discover it. One cannot
  564. emphasize strongly enough that to be truly secure RSA requires a secure
  565. implementation; mathematical security measures, such as choosing a long key
  566. size, are not enough. In practice, most successful attacks will likely be
  567. aimed at insecure implementations and at the key management stages of an RSA
  568. system. See Section 3 for discussion of secure key management in an
  569. RSA system.
  570.  
  571.  
  572. 2.6 Are strong primes necessary in RSA?
  573.  
  574. In the literature pertaining to RSA, it has often been suggested that in
  575. choosing a key pair, one should use ``strong'' primes p and q to generate
  576. the modulus n. Strong primes are those with certain properties that make
  577. the product n hard to factor by specific factoring methods; such
  578. properties have included, for example, the existence of a large prime
  579. factor of p-1 and a large prime factor of p+1. The reason for these
  580. concerns is that some factoring methods are especially suited to
  581. primes p such that p-1 or p+1 has only small factors; strong primes
  582. are resistant to these attacks.
  583.  
  584. However, recent advances in factoring (see Question 4.6) appear to
  585. have obviated the advantage of strong primes; the elliptic curve factoring
  586. algorithm is one such advance. The new factoring methods have as good a
  587. chance of success on strong primes as on ``weak'' primes; therefore, choosing
  588. strong primes does not significantly increase resistance to attacks. So for
  589. now the answer is negative: strong primes are not necessary when using RSA,
  590. although there is no danger in using them, except that it takes longer to
  591. generate a key pair. However, new factoring algorithms may be developed in
  592. the future which once again target primes with certain properties; if so,
  593. choosing strong primes may again help to increase security.
  594.  
  595.  
  596. 2.7 How large a modulus (key) should be used in RSA?
  597.  
  598. The best size for an RSA modulus depends on one's security needs. The larger
  599. the modulus, the greater the security but also the slower the RSA operations.
  600. One should choose a modulus length upon consideration, first, of one's
  601. security needs, such as the value of the protected data and how long it needs
  602. to be protected, and, second, of how powerful one's potential enemy is.
  603. It is also possible that a larger key size will allow a digitally signed
  604. document to be valid for a longer time; see Question 3.17.
  605.  
  606. A good analysis of the security obtained by a given modulus length is given
  607. by Rivest [72], in the context of discrete logarithms modulo a prime, but
  608. it applies to RSA as well. Rivest's estimates imply that a 512-bit modulus
  609. can be factored with an $8.2 million effort, less in the future. It may
  610. therefore be advisable to use a longer modulus, perhaps 768 bits in length.
  611. Those with extremely valuable data (or large potential damage from digital
  612. forgery) may want to use a still longer modulus. A certifying authority
  613. (see Question 3.5) might use a modulus of length 1000 bits or more, because
  614. the validity of so many other key pairs depends on the security of the one
  615. central key.
  616.  
  617. The key of an individual user will expire after a certain time, say, two
  618. years (see Question 3.12). Upon expiration, the user will generate a new
  619. key which should be at least a few digits longer than the old key to
  620. reflect the speed increases of computers over the two years. Recommended key
  621. length schedules will probably be published by some authority or public body.
  622.  
  623. Users should keep in mind that the estimated times to break RSA are averages
  624. only. A large factoring effort, attacking many thousands of RSA moduli, may
  625. succeed in factoring at least one in a reasonable time. Although the security
  626. of any individual key is still strong, with some factoring methods there is
  627. always a small chance that the attacker may get lucky and factor it quickly.
  628.  
  629. As for the slowdown caused by increasing the key size (see Question
  630. 2.3), doubling the modulus length would, on average, increase the
  631. time required for public-key operations (encryption and signature
  632. verification) by a factor of 4, and increase the time taken by private
  633. key operations (decryption and signing) by a factor of 8. The reason that
  634. public-key operations are affected less than private-key operations is that
  635. the public exponent can remain fixed when the modulus is increased, whereas
  636. the private exponent increases proportionally. Key generation time would
  637. increase by a factor of 16 upon doubling the modulus, but this is a
  638. relatively infrequent operation for most users.
  639.  
  640.  
  641. 2.8 How large should the primes be?
  642.  
  643. The two primes, p and q, which compose the modulus, should be of
  644. roughly equal length; this will make the modulus harder to factor than
  645. if one of the primes was very small. Thus if one chooses to use a 512-bit
  646. modulus, the primes should each have length approximately 256 bits.
  647.  
  648.  
  649. 2.9 How does one find random numbers for keys?
  650.  
  651. One needs a source of random numbers in order to find two random primes
  652. to compose the modulus. If one used a predictable method of generating
  653. the primes, an adversary could mount an attack by trying to recreate the
  654. key generation process.
  655.  
  656. Random numbers obtained from a physical process are in principle the best.
  657. One could use a hardware device, such as a diode; some are sold commercially
  658. on computer add-in boards for this purpose. Another idea is to use physical
  659. movements of the computer user, such as keystroke timings measured in
  660. microseconds. By whichever method, the random numbers may still contain
  661. some correlations preventing sufficient statistical randomness. Therefore,
  662. it is best to run them through a good hash function (see Question 8.2)
  663. before actually using them.
  664.  
  665. Another approach is to use a pseudorandom number generator fed by a random
  666. seed. Since these are deterministic algorithms, it is important to find
  667. one that is very unpredictable and also to use a truly random seed. There is
  668. a wide literature on the subject of pseudorandom number generators. See
  669. Knuth [41] for an introduction.
  670.  
  671. Note that one does not need random numbers to determine the public and
  672. private exponents in RSA, after choosing the modulus. One can simply
  673. choose an arbitrary value for the public exponent, which then determines
  674. the private exponent, or vice versa.
  675.  
  676.  
  677. 2.10 What if users of RSA run out of distinct primes?
  678.  
  679. There are enough prime numbers that RSA users will never run out of them.
  680. For example, the number of primes of length 512 bits or less exceeds
  681. 10^{150}, according to the prime number theorem; this is more than the
  682. number of atoms in the known universe.
  683.  
  684.  
  685. 2.11 How do you know if a number is prime?
  686.  
  687. It is generally recommended to use probabilistic primality testing, which
  688. is much quicker than actually proving a number prime. One can use a
  689. probabilistic test that decides if a number is prime with probability of
  690. error less than 2^{-100}. For further discussion of some primality testing
  691. algorithms, see the papers in the bibliography of [5]. For some empirical
  692. results on the reliability of simple primality tests see Rivest [70]; one
  693. can perform very fast primality tests and be extremely confident in the
  694. results. A simple algorithm for choosing probable primes was recently
  695. analyzed by Brandt and Damgard [9].
  696.  
  697.  
  698. 2.12 How is RSA used for encryption in practice?
  699.  
  700. RSA is combined with a secret-key cryptosystem, such as DES, to encrypt
  701. a message by means of an RSA digital envelope.
  702.  
  703. Suppose Alice wishes to send an encrypted message to Bob. She first
  704. encrypts the message with DES, using a randomly chosen DES key. Then
  705. she looks up Bob's public key and uses it to encrypt the DES key. The
  706. DES-encrypted message and the RSA-encrypted DES key together form the RSA
  707. digital envelope and are sent to Bob. Upon receiving the digital envelope,
  708. Bob decrypts the DES key with his private key, then uses the DES key
  709. to decrypt to message itself.
  710.  
  711.  
  712. 2.13 How is RSA used for authentication in practice?
  713.  
  714. Suppose Alice wishes to send a signed message to Bob. She uses a hash
  715. function on the message (see Question 8.2) to create a message digest,
  716. which serves as a ``digital fingerprint'' of the message. She then
  717. encrypts the message digest with her RSA private key; this is the digital
  718. signature, which she sends to Bob along with the message itself. Bob,
  719. upon receiving the message and signature, decrypts the signature with
  720. Alice's public key to recover the message digest. He then hashes the
  721. message with the same hash function Alice used and compares the result
  722. to the message digest decrypted from the signature. If they are exactly
  723. equal, the signature has been successfully verified and he can be confident
  724. that the message did indeed come from Alice. If, however, they are not
  725. equal, then the message either originated elsewhere or was altered after
  726. it was signed, and he rejects the message. Note that for authentication,
  727. the roles of the public and private keys are converse to their roles in
  728. encryption, where the public key is used to encrypt and the private key
  729. to decrypt.
  730.  
  731. In practice, the public exponent is usually much smaller than the
  732. private exponent; this means that the verification of a signature is faster
  733. than the signing. This is desirable because a message or document will
  734. only be signed by an individual once, but the signature may be verified
  735. many times.
  736.  
  737. It must be infeasible for anyone to either find a message that hashes to
  738. a given value or to find two messages that hash to the same value. If either
  739. were feasible, an intruder could attach a false message onto Alice's
  740. signature. Hash functions such as MD4 and MD5 (see Question 8.3) have been
  741. designed specifically to have the property that finding a match is
  742. infeasible, and are therefore considered suitable for use in cryptography.
  743.  
  744. One or more certificates (see Question 3.5) may accompany a digital
  745. signature. A certificate is a signed document attesting to the identity and
  746. public key of the person signing the message. Its purpose is to prevent
  747. someone from impersonating someone else, using a phony key pair. If a
  748. certificate is present, the recipient (or a third party) can check the
  749. authenticity of the public key, assuming the certifier's public key is
  750. itself trusted.
  751.  
  752.  
  753. 2.14 Does RSA help detect altered documents and transmission errors?
  754.  
  755. An RSA digital signature is superior to a handwritten signature in that
  756. it attests to the contents of a message as well as to the identity of
  757. the signer. As long as a secure hash function (see Question 8.2) is used,
  758. there is no way to take someone's signature from one document and attach
  759. it to another, or to alter the signed message in any way. The slightest
  760. change in a signed document will cause the digital signature verification
  761. process to fail. Thus, RSA authentication allows people to check the
  762. integrity of signed documents. Of course, if a signature verification
  763. fails, it may be unclear whether there was an attempted forgery or
  764. simply a transmission error.
  765.  
  766.  
  767. 2.15 What are alternatives to RSA?
  768.  
  769. Many other public-key cryptosystems have been proposed, as a look through
  770. the proceedings of the annual Crypto and Eurocrypt conferences quickly
  771. reveals. A mathematical problem called the knapsack problem was the basis
  772. for several systems [52], but these have lost favor because several
  773. versions were broken. Another system, designed by ElGamal [30], is based
  774. on the discrete logarithm problem. The ElGamal system was, in part, the
  775. basis for several later signature methods, including one by Schnorr [75],
  776. which in turn was the basis for DSS, the digital signature standard
  777. proposed by NIST (see Question 6.8). Because of the NIST proposal, the
  778. relative merits of these signature systems versus RSA signatures has
  779. received a lot of attention; see [57] for a discussion. The ElGamal system
  780. has been used successfully in applications; it is slower for encryption
  781. and verification than RSA and its signatures are larger than RSA signatures.
  782.  
  783. In 1976, before RSA, Diffie and Hellman [29] proposed a system for key
  784. exchange only; it permits secure exchange of keys in an otherwise
  785. conventional secret-key system. This system is in use today.
  786.  
  787. Cryptosystems based on mathematical operations on elliptic curves have
  788. also been proposed [43,56], as have cryptosystems based on discrete
  789. exponentiation in the finite field GF(2^n). The latter are very fast in
  790. hardware; however, doubts have been raised about their security because
  791. the underlying problem may be easier to solve than factoring [64,34].
  792. There are also some probabilistic encryption methods [8,32], which have
  793. the attraction of being resistant to a guessed ciphertext attack (see
  794. Question 2.5), but at a cost of data expansion. In probabilistic
  795. encryption, the same plaintext encrypted twice under the same key will
  796. give, with high probability, two different ciphertexts.
  797.  
  798. For digital signatures, Rabin [68] proposed a system which is provably
  799. equivalent to factoring; this is an advantage over RSA, where one may
  800. still have a lingering worry about an attack unrelated to factoring.
  801. Rabin's method is susceptible to a chosen message attack, however, in which
  802. the attacker tricks the user into signing messages of a special form. Another
  803. signature scheme, by Fiat and Shamir [31], is based on interactive
  804. zero-knowledge protocols, but can be adapted for signatures. It is faster
  805. than RSA and is provably equivalent to factoring, but the signatures are
  806. much larger than RSA signatures. Other variations, however, lessen the
  807. necessary signature length; see [17] for references. A system is
  808. ``equivalent to factoring'' if recovering the private key is provably as
  809. hard as factoring; forgery may be easier than factoring in some of the
  810. systems.
  811.  
  812. Advantages of RSA over other public-key cryptosystems include the fact that
  813. it can be used for both encryption and authentication, and that it has been
  814. around for many years and has successfully withstood much scrutiny. RSA has
  815. received far more attention, study, and actual use than any other public-key
  816. cryptosystem, and thus RSA has more empirical evidence of its security than
  817. more recent and less scrutinized systems. In fact, a large number of
  818. public-key cryptosystems which at first appeared secure were later broken;
  819. see [13] for some case histories.
  820.  
  821.  
  822. 2.16 Is RSA currently in use today?
  823.  
  824. The use of RSA is undergoing a period of rapid expansion and may become
  825. ubiquitous within a few years. It is currently used in a wide variety of
  826. products, platforms and industries around the world. It is found in many
  827. commercial software products and planned for many more. RSA is built into
  828. current or planned operating systems by Microsoft, Apple, Sun, and Novell.
  829. In hardware, RSA can be found in secure telephones, on Ethernet network
  830. cards, and on smart cards. RSA is also used internally in many institutions,
  831. including branches of the U.S. government, major corporations, national
  832. laboratories, and universities.
  833.  
  834. Adoption of RSA seems to be proceeding more quickly for authentication
  835. (digital signatures) than for privacy (encryption), perhaps in part because
  836. products for authentication are easier to export than those for privacy (see
  837. Question 1.6).
  838.  
  839.  
  840. 2.17 Is RSA an official standard today?
  841.  
  842. RSA is part of many official standards worldwide. The ISO (International
  843. Standards Organization) 9796 standard lists RSA as a compatible
  844. cryptographic algorithm, as does the Consultative Committee in International
  845. Telegraphy and Telephony (CCITT) X.509 security standard. RSA is part of
  846. the Society for Worldwide Interbank Financial Telecommunications (SWIFT)
  847. standard, the French financial industry's ETEBAC 5 standard, and the ANSI
  848. X9.31 draft standard for the U.S. banking industry. The Australian key
  849. management standard, AS2805.6.5.3, also specifies RSA.
  850.  
  851. RSA is found in Internet's proposed PEM (Privacy Enhanced Mail) standard
  852. (see Question 8.7) and the PKCS standard for the software industry
  853. (see Question 8.9). The OSI Implementors' Workshop (OIW) has issued
  854. implementers' agreements referring to PKCS and PEM, which each include RSA.
  855.  
  856. A number of other standards are currently being developed and will
  857. be announced over the next couple of years; many are expected to include
  858. RSA as either an endorsed or a recommended system for privacy and/or
  859. authentication. See [38] for a more comprehensive survey of cryptography
  860. standards.
  861.  
  862.  
  863. 2.18 Is RSA a de facto standard? Why is a de facto standard important?
  864.  
  865. RSA is the most widely used public-key cryptosystem today and has often
  866. been called a de facto standard. Regardless of the official standards, the
  867. existence of a de facto standard is extremely important for the development
  868. of a digital economy. If one public-key system is used everywhere for
  869. authentication, then signed digital documents can be exchanged between users
  870. in different nations using different software on different platforms; this
  871. interoperability is necessary for a true digital economy to develop.
  872.  
  873. The lack of secure authentication has been a major obstacle in achieving
  874. the promise that computers would replace paper; paper is still necessary
  875. almost everywhere for contracts, checks, official letters, legal documents,
  876. and identification. With this core of necessary paper transaction, it has not
  877. been feasible to evolve completely into a society based on electronic
  878. transactions. Digital signatures are the exact tool necessary to convert
  879. the most essential paper-based documents to digital electronic media.
  880. Digital signatures makes it possible, for example, to have leases, wills,
  881. passports, college transcripts, checks, and voter registration forms that
  882. exist only in electronic form; any paper version would just be a ``copy''
  883. of the electronic original. All of this is enabled by an accepted standard
  884. for digital signatures.
  885.  
  886. 2.19 Is RSA patented?
  887.  
  888. RSA is patented under U.S. Patent 4,405,829, issued 9/20/83 and held by
  889. Public Key Partners (PKP), of Sunnyvale, California; the patent expires 17
  890. years after issue, in 2000. RSA is usually licensed together with other
  891. public-key cryptography patents (see Question 1.5). PKP has a standard,
  892. royalty-based licensing policy which can be modified for special
  893. circumstances. If a software vendor, having licensed the public-key patents,
  894. incorporates RSA into a commercial product, then anyone who purchases the
  895. end product has the legal right to use RSA within the context of that
  896. software. The U.S. government can use RSA without a license because it was
  897. invented at MIT with partial government funding. RSA is not patented outside
  898. North America.
  899.  
  900. In North America, a license is needed to ``make, use or sell'' RSA. However,
  901. PKP usually allows free non-commercial use of RSA, with written permission,
  902. for personal, academic or intellectual reasons. Furthermore, RSA
  903. Laboratories has made available (in the U.S. and Canada) at no charge a
  904. collection of cryptographic routines in source code, including the RSA
  905. algorithm; it can be used, improved and redistributed non-commercially
  906. (see Question 8.10).
  907.  
  908.  
  909. 2.20 Can RSA be exported from the U.S.?
  910.  
  911. Export of RSA falls under the same U.S. laws as all other cryptographic
  912. products. See Question 1.6 for details.
  913.  
  914. RSA used for authentication is more easily exported than when used for
  915. privacy. In the former case, export is allowed regardless of key (modulus)
  916. size, although the exporter must demonstrate that the product cannot be
  917. easily converted to use for encryption. In the case of RSA used for
  918. privacy (encryption), the U.S. government generally does not allow
  919. export if the key size exceeds 512 bits. Export policy is currently a
  920. subject of debate, and the export status of RSA may well change in the
  921. next year or two.
  922.  
  923. Regardless of U.S. export policy, RSA is available abroad in non-U.S.
  924. products.
  925.  
  926.  
  927.  
  928.        --------------------------------------------
  929.  
  930. RSA Laboratories is the research and consultation division of RSA Data
  931. Security, Inc., the company founded by the inventors of the RSA
  932. public-key cryptosystem. RSA Laboratories reviews, designs and
  933. implements secure and efficient cryptosystems of all kinds. Its
  934. clients include government agencies, telecommunications companies,
  935. computer manufacturers, software developers, cable TV broadcasters,
  936. interactive video manufacturers, and satellite broadcast companies,
  937. among others.
  938.  
  939. For more information about RSA Laboratories, call or write to
  940.                         RSA Laboratories
  941.                         100 Marine Parkway
  942.                         Redwood City, CA 94065
  943.                         (415) 595-7703
  944.                         (415) 595-4126 (fax)
  945.  
  946.  
  947.  
  948. PKCS, RSAREF and RSA Laboratories are trademarks of RSA Data
  949. Security, Inc. All other trademarks belong to their respective
  950. companies.
  951.  
  952. This document is available in ASCII, Postscript, and Latex formats
  953. via anonymous FTP to rsa.com:/pub/faq.
  954.  
  955. Please send comments and corrections to faq-editor@rsa.com.
  956.  
  957.  
  958.  
  959. ===
  960. DISTRIBUTION: How to obtain this document
  961.  
  962. This document has been brought to you in part by CRAM, involved in the
  963. redistribution of valuable information to a wider USENET audience (see
  964. below). The most recent version of this document can be obtained via
  965. the author's instructions above. The following directions apply to
  966. retrieve the possibly less-current USENET FAQ version.
  967.  
  968.   FTP
  969.   ---
  970.     This FAQ is available from the standard FAQ server rtfm.mit.edu via
  971.     FTP in the directory /pub/usenet/news.answers/cryptography-faq/rsa/
  972.  
  973.   Email
  974.   -----
  975.     Email requests for FAQs go to mail-server@rtfm.mit.edu with commands
  976.     on lines in the message body, e.g. `help' and `index'.
  977.  
  978.   Usenet
  979.   ------
  980.     This FAQ is posted every 21 days to the groups
  981.  
  982.       sci.crypt
  983.       talk.politics.crypto
  984.       alt.security.ripem
  985.       sci.answers
  986.       talk.answers
  987.       alt.answers
  988.       news.answers
  989.  
  990. ===
  991. CRAM: the Cyberspatial Reality Advancement Movement
  992.  
  993. In an effort to bring valuable information to the masses, and
  994. as a service to motivated information compilers, I
  995. (L. Detweiler) will help others unfamiliar with Usenet
  996. `publish' their documents for widespread dissemination via the
  997. FAQ structure, and act as a `sponsor' knowledgable in the
  998. submissions process. This document is being distributed under
  999. this arrangement.
  1000.  
  1001. I have found these compilations tend to appear on various
  1002. mailing lists and are valuable enough to deserve wider
  1003. distribution. If you know of an existing compilation of
  1004. Internet information that is not currently a FAQ, please
  1005. contact me and I may `sponsor' it. The benefits to the author
  1006. include:
  1007.  
  1008. - use of the existing FAQ infrastructure for distribution:
  1009.   - automated mail server service
  1010.   - FTP archival
  1011.   - automated posting
  1012.  
  1013. - a far wider audience that can improve the quality, accuracy,
  1014.   and coverage of the document enormously through email
  1015.   feedback
  1016.  
  1017. - potential professional inquiries for the use of your
  1018.   document in other settings, such as newsletters, books,
  1019.   etc.
  1020.  
  1021. - with me as your sponsor, I will also take care of the
  1022.   technicalities in the proper format of the posted version
  1023.   and updating procedures, leaving you free of the `overhead'
  1024.   to focus on the basic updates alone
  1025.  
  1026. Send comments relating to the *distribution* of this document
  1027. (particularly relevant newsgroups not currently covered in
  1028. its current distribution) or inquiries on other documents to
  1029. <ld231782@longs.lance.colostate.edu>.
  1030.  
  1031. The choice of who I `sponsor' is entirely arbitrary. You always
  1032. have the option of handling the submission process yourself.
  1033. See the FAQ submission guidelines FAQ in news.answers.
  1034.  
  1035.  
  1036.